package com.relytosoft.mizar.analyze.common.feign;

import com.relytosoft.dubhe.common.core.object.ResponseResult;
import com.relytosoft.mizar.analyze.base.constant.MediaCommonConstants;
import com.relytosoft.mizar.analyze.common.config.StrategyFeignInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author lj
 * @date 2022/5/19 10:51
 */
@FeignClient(contextId = "SystemFeignService", value = MediaCommonConstants.SYSTEM_SERVICE_NAME, fallbackFactory = SystemFeignFallbackFactory.class, configuration = StrategyFeignInterceptor.class)
public interface SystemFeignService {

    /**
     * 根据ID批量查询库信息
     *
     * @param bodys 库集合
     * @return ResponseResult
     */
    @PostMapping(value = "/system/group/batch", consumes = "application/json")
    ResponseResult selectGroupByIds(@RequestBody String bodys);

    /**
     * 获取计划模板详细信息
     *
     * @param templateId 模板ID
     * @return ResponseResult
     */
    @GetMapping(value = "/system/plantemplate/{templateId}", consumes = "application/json")
    ResponseResult id(@PathVariable(value = "templateId") Integer templateId);

    /**
     * 添加布控计划
     *
     * @param bodys 请求信息
     * @return ResponseResult
     */
    @PostMapping(value = "/system/dispositionplan/add", consumes = "application/json")
    ResponseResult add(@RequestBody String bodys);

    /**
     * 根据布控ID查询布控计划
     *
     * @param id 布控ID
     * @return ResponseResult
     */
    @GetMapping(value = "/system/dispositionplan/{id}", consumes = "application/json")
    ResponseResult selectById(@PathVariable(value = "id") Integer id);


    /**
     * 修改布控计划
     *
     * @param bodys
     * @return
     */
    @PostMapping(value = "/system/dispositionplan/update", consumes = "application/json")
    ResponseResult updateDispositionPlan(@RequestBody String bodys);


    @PostMapping(value = "/system/alarm/add", consumes = "application/json")
    ResponseResult addAyAlarm(@RequestBody String bodys);

}
